﻿


<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
      <title>CloudBOX | 登录</title>
      <link rel="shortcut icon" href="assets/images/logo_ico.png" type="img/png"/>
      <link rel="stylesheet" href="assets/vendor/notice/bootstrap-4.0.0-dist/css/bootstrap.min.css">
      <link rel="stylesheet" href="assets/css/backend.min.css">
      <link rel="stylesheet" href="assets/vendor/@fortawesome/fontawesome-free/css/all.min.css">
      <link rel="stylesheet" href="assets/vendor/line-awesome/dist/line-awesome/css/line-awesome.min.css">
      <link rel="stylesheet" href="assets/vendor/remixicon/fonts/remixicon.css">
      <link rel="stylesheet" href="assets/vendor/doc-viewer/include/pdf/pdf.viewer.css">
      <link rel="stylesheet" href="assets/vendor/doc-viewer/include/PPTXjs/css/pptxjs.css">
      <link rel="stylesheet" href="assets/vendor/doc-viewer/include/PPTXjs/css/nv.d3.min.css">
      <link rel="stylesheet" href="assets/vendor/doc-viewer/include/SheetJS/handsontable.full.min.css">
      <link rel="stylesheet" href="assets/vendor/doc-viewer/include/verySimpleImageViewer/css/jquery.verySimpleImageViewer.css">
      <link rel="stylesheet" href="assets/vendor/doc-viewer/include/officeToHtml/officeToHtml.css">
      <link rel="stylesheet" href="assets/vendor/notice/css/bs4.pop.css">
  </head>

  <body class=" ">

    <div id="loading">
          <div id="loading-center">
          </div>
    </div>

    
      <div class="wrapper">
      <section class="login-content">
         <div class="container h-100">
            <div class="row justify-content-center align-items-center height-self-center">
               <div class="col-md-5 col-sm-12 col-12 align-self-center">
                  <div class="sign-user_card">
                        <img src="assets/images/logo.png" class="img-fluid rounded-normal light-logo logo" alt="logo">
                        <img src="assets/images/logo-white.png" class="img-fluid rounded-normal darkmode-logo logo" alt="logo">
                     <h3 class="mb-3">登 录</h3>
                     <p>欢迎使用cloud 云盘.</p>
                     <form>
                        <div class="row">
                           <div class="col-lg-12">
                              <div class="floating-label form-group">
                                 <input class="floating-input form-control" type="text" id="username" placeholder=" " required>
                                 <label>账号</label>
                              </div>
                           </div>
                           <div class="col-lg-12">
                              <div class="floating-label form-group">
                                 <input class="floating-input form-control" type="password" id="password" placeholder=" " required>
                                 <label>密码</label>
                              </div>
                           </div>
                        </div>
                        <button type="button" id="login" class="btn btn-primary">登 录</button>
                        <p class="mt-3">
                           创建一个新账号？ <a href="auth-sign-up.html" class="text-primary">注 册</a>
                        </p>
                     </form>
                  </div>
               </div>
            </div>
         </div>
      </section>
      </div>

    <script src="assets/js/jquery-1.8.3.min.js"></script>
    <script src="assets/js/backend-bundle.min.js"></script>
    <script src="assets/js/customizer.js"></script>
    <script src="assets/js/chart-custom.js"></script>
    <script src="assets/vendor/doc-viewer/include/pdf/pdf.js"></script>
    <script src="assets/vendor/doc-viewer/include/docx/jszip-utils.js"></script>
    <script src="assets/vendor/doc-viewer/include/docx/mammoth.browser.min.js"></script>
    <script src="assets/vendor/doc-viewer/include/PPTXjs/js/filereader.js"></script>
    <script src="assets/vendor/doc-viewer/include/PPTXjs/js/d3.min.js"></script>
    <script src="assets/vendor/doc-viewer/include/PPTXjs/js/nv.d3.min.js"></script>
    <script src="assets/vendor/doc-viewer/include/PPTXjs/js/pptxjs.js"></script>
    <script src="assets/vendor/doc-viewer/include/PPTXjs/js/divs2slides.js"></script>
    <script src="assets/vendor/doc-viewer/include/SheetJS/handsontable.full.min.js"></script>
    <script src="assets/vendor/doc-viewer/include/SheetJS/xlsx.full.min.js"></script>
    <script src="assets/vendor/doc-viewer/include/verySimpleImageViewer/js/jquery.verySimpleImageViewer.js"></script>
    <script src="assets/vendor/doc-viewer/include/officeToHtml/officeToHtml.js"></script>
    <script src="assets/js/doc-viewer.js"></script>
    <script src="assets/js/app.js"></script>
    <script src="assets/vendor/notice/js/bs4.pop.js"></script>
    <script src="assets/vendor/notice/bootstrap-4.0.0-dist/js/bootstrap.min.js"></script>
    <script type="text/javascript">
        $("#login").click(function () {
            var username = $("#username").val();
            var password = $("#password").val();

            if (username == null || username == '') {
                bs4pop.notice('请输入您的账号！', {type: 'danger'});
                return;
            }
            if (password == null || password == '') {
                bs4pop.notice('请输入您的密码！', {type: 'danger'});
                return;
            }

            $.ajax({
                url: 'cloud-user/login',
                data: {
                    username : $("#username").val(),
                    password: $("#password").val()
                },
                type: 'post',
                dataType: 'json',
                success : function (result) {
                    if (result.code == 200) {
                        visitAccess();
                        location.href="page-index.html";
                    }else {
                        $("#password").val("");
                        bs4pop.notice(result.message, {type: 'danger'});
                    }
                }
            });
        });

        /**
         * 访问量数据接入
         */
        function visitAccess() {
            $.ajax({
                url: 'cloud-visit/access',
                type: 'post',
                dataType: 'json',
                success: function (result) {
                    console.info("访问量数据接入成功.");
                }
            });
        };
    </script>
  </body>
</html>